<?php


namespace app\admin\controllers;


use app\admin\services\GameService;
use app\BaseController;
use app\Request;

class GameController extends BaseController
{
    private $gameService;

    public function __construct(GameService $gameService)
    {
        $this->gameService = $gameService;
    }

    public function index(Request $request)
    {
        $result = $this->gameService->index($request);
        return $this->success($result);
    }

    public function create(Request $request)
    {
        $result = $this->gameService->create($request);
        return $this->success($result);
    }

    public function update(Request $request, $id)
    {
        $result = $this->gameService->update($request, $id);
        return $this->success($result);
    }

    public function delete($id)
    {
        $result = $this->gameService->delete($id);
        return $this->success($result);
    }

    public function show($id)
    {
        $result = $this->gameService->show($id);
        return $this->success($result);
    }

    public function cache()
    {
        $result = $this->gameService->cache();
        return $this->success($result);
    }
}
